package gui;

import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

/**
 * Klasse ersetzt den Apple eigenen About Dialog
 * 
 * @author Michi
 * 
 */
public class AboutDialog extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8256096398534586766L;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AboutDialog frame = new AboutDialog();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public AboutDialog() {
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent arg0) {
				dispose();
			}
		});
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		GridBagLayout gbl_contentPane = new GridBagLayout();
		gbl_contentPane.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
		gbl_contentPane.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
		gbl_contentPane.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0,
				0.0, 0.0, 0.0, Double.MIN_VALUE };
		gbl_contentPane.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0,
				0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
		contentPane.setLayout(gbl_contentPane);

		JLabel lblProgrammname = new JLabel("Programmname:");
		GridBagConstraints gbc_lblProgrammname = new GridBagConstraints();
		gbc_lblProgrammname.insets = new Insets(0, 0, 5, 5);
		gbc_lblProgrammname.anchor = GridBagConstraints.EAST;
		gbc_lblProgrammname.gridx = 1;
		gbc_lblProgrammname.gridy = 0;
		contentPane.add(lblProgrammname, gbc_lblProgrammname);

		JLabel lblFireballOrganizer = new JLabel("FireBall Organizer 1.0");
		GridBagConstraints gbc_lblFireballOrganizer = new GridBagConstraints();
		gbc_lblFireballOrganizer.insets = new Insets(0, 0, 5, 5);
		gbc_lblFireballOrganizer.gridx = 3;
		gbc_lblFireballOrganizer.gridy = 0;
		contentPane.add(lblFireballOrganizer, gbc_lblFireballOrganizer);

		JLabel label = new JLabel("   ");
		GridBagConstraints gbc_label = new GridBagConstraints();
		gbc_label.insets = new Insets(0, 0, 5, 5);
		gbc_label.gridx = 6;
		gbc_label.gridy = 0;
		contentPane.add(label, gbc_label);

		JLabel label_1 = new JLabel("   ");
		GridBagConstraints gbc_label_1 = new GridBagConstraints();
		gbc_label_1.insets = new Insets(0, 0, 5, 5);
		gbc_label_1.gridx = 2;
		gbc_label_1.gridy = 1;
		contentPane.add(label_1, gbc_label_1);

		JLabel lblEntwickler = new JLabel("Entwickler:");
		GridBagConstraints gbc_lblEntwickler = new GridBagConstraints();
		gbc_lblEntwickler.anchor = GridBagConstraints.EAST;
		gbc_lblEntwickler.insets = new Insets(0, 0, 5, 5);
		gbc_lblEntwickler.gridx = 1;
		gbc_lblEntwickler.gridy = 2;
		contentPane.add(lblEntwickler, gbc_lblEntwickler);

		JLabel label_2 = new JLabel("   ");
		GridBagConstraints gbc_label_2 = new GridBagConstraints();
		gbc_label_2.insets = new Insets(0, 0, 5, 0);
		gbc_label_2.gridx = 7;
		gbc_label_2.gridy = 2;
		contentPane.add(label_2, gbc_label_2);

		JLabel lblBrandtM = new JLabel("Brandt, M.");
		GridBagConstraints gbc_lblBrandtM = new GridBagConstraints();
		gbc_lblBrandtM.anchor = GridBagConstraints.WEST;
		gbc_lblBrandtM.insets = new Insets(0, 0, 5, 5);
		gbc_lblBrandtM.gridx = 3;
		gbc_lblBrandtM.gridy = 3;
		contentPane.add(lblBrandtM, gbc_lblBrandtM);

		JLabel lblKferF = new JLabel("K\u00E4fer, F.");
		GridBagConstraints gbc_lblKferF = new GridBagConstraints();
		gbc_lblKferF.anchor = GridBagConstraints.WEST;
		gbc_lblKferF.insets = new Insets(0, 0, 5, 5);
		gbc_lblKferF.gridx = 3;
		gbc_lblKferF.gridy = 4;
		contentPane.add(lblKferF, gbc_lblKferF);

		JLabel lblRlerF = new JLabel("R\u00F6\u00DFler, F.");
		GridBagConstraints gbc_lblRlerF = new GridBagConstraints();
		gbc_lblRlerF.anchor = GridBagConstraints.WEST;
		gbc_lblRlerF.insets = new Insets(0, 0, 5, 5);
		gbc_lblRlerF.gridx = 3;
		gbc_lblRlerF.gridy = 5;
		contentPane.add(lblRlerF, gbc_lblRlerF);

		JLabel lblWengM = new JLabel("Weng, M.");
		GridBagConstraints gbc_lblWengM = new GridBagConstraints();
		gbc_lblWengM.insets = new Insets(0, 0, 5, 5);
		gbc_lblWengM.anchor = GridBagConstraints.WEST;
		gbc_lblWengM.gridx = 3;
		gbc_lblWengM.gridy = 6;
		contentPane.add(lblWengM, gbc_lblWengM);

		JLabel label_3 = new JLabel("  ");
		GridBagConstraints gbc_label_3 = new GridBagConstraints();
		gbc_label_3.insets = new Insets(0, 0, 5, 5);
		gbc_label_3.gridx = 3;
		gbc_label_3.gridy = 7;
		contentPane.add(label_3, gbc_label_3);

		Icon donate = new ImageIcon("src/pictures/Pay-Pal-Donation.png");
		JButton button = new JButton(donate);
		button.setPreferredSize(new Dimension(75, 50));
		GridBagConstraints gbc_button = new GridBagConstraints();
		gbc_button.fill = GridBagConstraints.BOTH;
		gbc_button.insets = new Insets(0, 0, 0, 5);
		gbc_button.gridx = 3;
		gbc_button.gridy = 8;
		contentPane.add(button, gbc_button);
	}

}
